import java.util.Scanner;


public class Input
{
   public static int readInt(Scanner in, String prompt, String error, int min, int max)
   {
      System.out.println(prompt);
      in = new Scanner(System.in);
      int myinput=in.nextInt();
      while(myinput>max||myinput<min)
      {
         System.out.println(error);
         myinput = in.nextInt();
      }
      return myinput;
   }
}
